require(['element', 'diff', 'patch'], function (ele, diff, patch) {
    const virtualDom = ele.createElement('ul', {class: 'list'}, [
        ele.createElement('li', {class: 'item', style: "color: red;"}, ['Javascript']),
        ele.createElement('li', {class: 'item'}, ['NodeJs']),
        ele.createElement('li', {class: 'item'}, ['HTML']),
        ele.createElement('li', {class: 'item'}, ['CSS']),
        ele.createElement('li', {class: 'item'}, ['MiniProgram']),
        ele.createElement('li', {class: 'item'}, ['MySQL'])
    ])
    
    console.log(virtualDom);
    
    let el = ele.render(virtualDom)
    ele.renderDom(el, document.getElementById('root'))

    // 创建另一个新的虚拟DOM
    let virtualDom2 = ele.createElement('ul', {class: 'list-group'}, [
        ele.createElement('li', {class: 'item active'}, ['七里香']),
        ele.createElement('li', {class: 'item'}, ['一千年以后']),
        ele.createElement('li', {class: 'item'}, ['需要人陪'])    
    ]);

    let patches = diff.diff(virtualDom, virtualDom2)
    console.log(patches)
    patch.patch(el, patches)

})

// const { createElement, render, renderDom } = require('./element')

